package rpc.server;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.ipc.RPC;
import rpc.StudentNameInterface;

public class StudentNameServer {
    public static void main(String[] args) {
        RPC.Builder builder = new RPC.Builder(new Configuration());
        builder.setBindAddress("127.0.0.1")
                .setPort(12345)
                .setProtocol(StudentNameInterface.class)
                .setInstance(new StudentNameImpl())
        ;

        RPC.Server server = null;
        try {
            server = builder.build();
        } catch (Throwable t) {
            t.printStackTrace();
            return;
        }
        server.start();
    }
}
